<?php

use Phinx\Migration\AbstractMigration;

class AddPackNameAndIsUploadColumnsInVersionTable extends AbstractMigration
{
    public function up()
    {
        $this->table('version')
            ->addColumn('is_uploaded', 'enum', [
                'values' => 'yes,no',
                'null' => false,
                'default' => 'no',
                'comment' => '是否上传',
            ])->addColumn('pack_name', 'string', [
                'limit' => 128,
                'null' => false,
                'default' => '',
                'comment' => '打包名称',
            ])
            ->save();
    }

    public function down()
    {
        $this->table('version')
            ->removeColumn('is_uploaded')
            ->removeColumn('pack_name')
            ->save();
    }
}
